#ifndef __NJGIS_NJMODELSERVICE_H__
#define __NJGIS_NJMODELSERVICE_H__

#include "../include/INxModelService.h"
#include "NxService.h"

namespace NJGIS
{
	namespace SERVICE
	{
		class NjModelService : public virtual INjModelService, public virtual NjService
		{
		public:
			NjModelService(){};

			NjModelService(const char* oid, const char* ip, int port):_oid(oid), NjService(ip, port){};

			NjModelService(
				const char* oid, 
				const char* name, 
				const char* type, 
				const char* url, 
				const char* pid, 
				const char* mid, 
				bool registered, 
				const char* description, 
				const char* version,
				NJGIS::SERVICE::NjPlatform platform, 
				const char* deploytime, 
				const char* img, 
				const char* deployorname,
				const char* deployemail, 
				NJGIS::SERVICE::NjModelServiceStatus status, 
				NJGIS::SERVICE::NjModelServiceLimitation limit,
				NJGIS::SERVICE::NjModelServicePermission permission, 
				const char* ip, 
				int port ):
					_oid(oid),
					_name(name),
					_type(type),
					_url(url),
					_pid(pid),
					_mid(mid),
					_registered(registered),
					_description(description),
					_version(version),
					_platform(platform),
					_deploymentTime(deploytime),
					_img(img),
					_deployorName(deployorname),
					_deployorEmail(deployemail),
					_status(status),
					_limit(limit),
					_permission(permission),
					NjService(ip, port){}

			virtual const char* getServiceOID();

			virtual const char* getServiceName();

			virtual const char* getServiceType();

			virtual const char* getServiceDetailURL();

			virtual const char* getServicePid();

			virtual const char* getServiceMid();

			virtual bool getServiceRegister();

			virtual const char* getServiceDescription();

			virtual const char* getServiceVersion();

			virtual const NJGIS::SERVICE::NjPlatform getServicePlatform();

			virtual const char* getDeploymentTime();

			virtual const char* getImage();

			virtual const char* getServiceDeployorName();

			virtual const char* getServiceDeployorEmail();

			virtual NJGIS::SERVICE::NjModelServiceStatus getServiceStatus();

			virtual NJGIS::SERVICE::NjModelServiceLimitation getServiceLimitation();

			virtual const NJGIS::SERVICE::NjModelServicePermission getServicePermission();

			virtual int invoke( INjDataConfiguration* config, std::string& recordid );

			//! to refresh the information of this model service
			virtual int refresh();

		private:
			std::string _oid;

			std::string _name;

			std::string _type;

			std::string _url;

			std::string _pid;

			std::string _mid;

			bool _registered;

			std::string _description;

			std::string _version;

			NJGIS::SERVICE::NjPlatform _platform;

			std::string _deploymentTime;

			std::string _img;

			std::string _deployorName;

			std::string _deployorEmail;

			NJGIS::SERVICE::NjModelServiceStatus _status;

			NJGIS::SERVICE::NjModelServiceLimitation _limit;

			NJGIS::SERVICE::NjModelServicePermission _permission;
		};
	}
}

#endif